package com.tencent.wuyanzu.whattoeat;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.tencent.wuyanzu.whattoeat.Entity.Food;
import com.tencent.wuyanzu.whattoeat.util.ViewImageLoadURL;

/**
 * Created by maiffany on 16/7/26.
 */
public class EvaluateActivity extends Activity {

    private TextView foodThurmUpTV=null;
    private TextView foodThurmDownTV=null;
    private TextView foodNameTV=null;
    private ImageView foodImageIV=null;

    private Button refuse=null;
    private Button thurmUp=null;
    private Button thurmDown=null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_food_evaluate);
        foodThurmDownTV=(TextView)findViewById(R.id.select_thurm_down_number);
        foodThurmUpTV=(TextView)findViewById(R.id.select_thurm_up_number);
        foodNameTV=(TextView)findViewById(R.id.select_food_name);
        foodImageIV=(ImageView)findViewById(R.id.eventual_food_image);

        final Food selectFood=(Food) getIntent().getExtras().get("foodDetail");
        foodThurmUpTV.setText(""+selectFood.getUp());
        foodThurmDownTV.setText(""+selectFood.getDown());
        foodNameTV.setText(""+selectFood.getName());
        ViewImageLoadURL bitmapLoadURL=new ViewImageLoadURL();
        bitmapLoadURL.execute(selectFood.getUrl(), foodImageIV);

        refuse=(Button)findViewById(R.id.food_evaluate_refuse) ;
        thurmUp=(Button)findViewById(R.id.select_thurm_up);
        thurmDown=(Button)findViewById(R.id.select_thurm_down);
        View.OnClickListener onClickListener=new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(EvaluateActivity.this,MainActivity.class);
                startActivity(intent);
                finish();
            }
        };
        refuse.setOnClickListener(onClickListener);
        thurmDown.setOnClickListener(onClickListener);
        thurmUp.setOnClickListener(onClickListener);

    }
}
